//package com.yunxin.core.wechat.task;
//
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
//import com.yunxin.core.wechat.domain.WechatAuth;
//import com.yunxin.core.wechat.service.QyWxService;
//import com.yunxin.core.wechat.service.WechatAuthService;
//import lombok.RequiredArgsConstructor;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Component;
//import org.springframework.util.ObjectUtils;
//
//@Component
//@Slf4j
//@RequiredArgsConstructor
//public class GetPermanentCodeTask {
//
//    @Autowired
//    private QyWxService qyWxService;
//    @Autowired
//    private WechatAuthService wechatAuthService;
//
//    @Scheduled(fixedRate = 10000)
//    public void GetPermanentCodeMethod(){
//        LambdaQueryWrapper<WechatAuth> wechatAuthWrapper = new LambdaQueryWrapper<>();
//        wechatAuthWrapper.eq(WechatAuth::getStatus,0)
//                .orderByDesc(WechatAuth::getId)
//                .last("limit 1");
//        WechatAuth wechatAuth = wechatAuthService.getOne(wechatAuthWrapper);
//        if (ObjectUtils.isEmpty(wechatAuth)){
//            return ;
//        }
//        qyWxService.getPermanentCode(wechatAuth);
//
//    }
//
//
//}
